<!DOCTYPE html>
<html>

<head>
    <title>demo</title>
    <link rel="stylesheet" href="src/js/libs/maptalks.css" />
    <style>
        html,
        body {
            margin: 0px;
            height: 100%;
            width: 100%;
        }
        
        .container {
            width: 100%;
            height: 100%;
        }
        
        #message {
            position: fixed;
            top: 30px;
            right: 20px;
            height: 100px;
            display: flex;
            align-items: center;
            justify-content: center;
            align-content: center;
            flex-direction: column;
            color: #000;
            font-size: 12px;
        }
    </style>
</head>

<body>
    <div id="map" class="container"></div>
    <div id="message"></div>
    <script src="src/js/libs/maptalks.js"></script>
    <script src="src/js/libs/jquery.js"></script>
    <script src="src/js/app.js"></script>
    <script>
        const map = new MapClass([110.41913, 19.72393]);
        map
            .getStatus("message")
            .drawPolygons(
                new Promise((resolve, reject) => {
                    map.query.getJSON(
                        "./assets/geojson/haikou.json",
                        (mapData) => {
                            resolve(mapData.features);
                        },
                        (e) => {
                            reject(e);
                        }
                    );
                })
            )
            .drawLines(
                new Promise((resolve, reject) => {
                    map.query.getJSON(
                        "../assets/geojson/highway.json",
                        (highway) => {
                            resolve(highway.data);
                        },
                        (e) => {
                            reject(e);
                        }
                    );
                })
            )
            .drawMarkers(
                new Promise((resolve, reject) => {
                    map.query.getJSON(
                        "../assets/geojson/markers.json",
                        (markers) => {
                            resolve(markers.data);
                        },
                        (e) => {
                            reject(e);
                        }
                    );
                })
            );
        map.drawRoadTileLayer();
        console.log(map);
    </script>
</body>

</html>